<?php
/*
* 碎语部分
*/
if(!defined('EMLOG_ROOT')) {exit('error!');}
?>
<div id="content" class="single">
	<div class="sitemap cbx">
		<a href="<?php echo BLOG_URL; ?>" title="返回博客首页">首页</a>
		&nbsp;&raquo;&nbsp;碎语
	</div>
	<div class="tw">
		<ol>
			<?php
			foreach($tws as $val):
			$author = $user_cache[$val['author']]['name'];
			$avatar = empty($user_cache[$val['author']]['avatar']) ?
						BLOG_URL . 'admin/views/images/avatar.jpg' :
						BLOG_URL . $user_cache[$val['author']]['avatar'];
			$tid = (int)$val['id'];
			$img = empty($val['img']) ? "" : '<a title="点击查看图片" href="'.BLOG_URL.str_replace('thum-', '', $val['img']).'" target="_blank"><img alt="碎语图像 - '.BLOG_NAME.'" style="border: 1px solid #EFEFEF;" src="'.BLOG_URL.$val['img'].'"/></a>';
			?>
			<li class="li">

				<div class="tw-body">
					<div class="tw-text">
						<div class="gravatar">
							<a href="<?php echo BLOG_URL; ?>"><img src="<?php echo $avatar; ?>" width="32px" height="32px" /></a>
						</div>
						<div class="tw-meta">
							<a href="<?php echo BLOG_URL; ?>"><span class="author"><?php echo $author; ?></span></a>
							<span class="time">(<?php echo $val['date'];?>)</span>

						</div>
						<div class="tw-p">
							<?php echo '<pre>'.html_entity_decode($val['t']).'</pre>';?>
							<p class="post1"><?php echo $img;?></p>
							<span class="reply" style="display: none;"> <a href="javascript:loadr('<?php echo DYNAMIC_BLOGURL; ?>?action=getr&tid=<?php echo $tid;?>','<?php echo $tid;?>');">回复(<span id="rn_<?php echo $tid;?>"><?php echo $val['replynum'];?></span>)</a> </span>
						</div>
					</div>
				</div>

				<ul id="r_<?php echo $tid;?>" class="r"></ul>
				<div class="huifu" id="rp_<?php echo $tid;?>" style="display:none;">
					<textarea id="rtext_<?php echo $tid; ?>"></textarea>
					<p><br/>
					<span class="tinfo" style="display:<?php if(ROLE == 'admin' || ROLE == 'writer'){echo 'none';}?>">
					昵称：<input type="text" class="textinupt" id="rname_<?php echo $tid; ?>" value="<?php echo $ckname; ?>" />
					<span style="display:<?php if($reply_code == 'n'){echo 'none';}?>">验证码：<input type="text" id="rcode_<?php echo $tid; ?>" value="" /><?php echo $rcode; ?></span>
					</span>
					<button type="button" class="btn btn-success btn-sm" tabindex="6" id="submit" style="width:222px;" onclick="reply('<?php echo DYNAMIC_BLOGURL; ?>index.php?action=reply',<?php echo $tid;?>);"><span class="glyphicon glyphicon-flag"></span>　发表评论</button>
					</p>
					<div class="msg"><span id="rmsg_<?php echo $tid; ?>" style="color:#FF0000"></span></div>
				</div>
			</li>
			<?php endforeach;?>
			<div class="pagenavi pnb">
			<span style="font-size:102%;"><?php echo $pageurl;?></span>
			</div>
		</ol>
	</div>
</div>
<?php
 include View::getView('side');
 include View::getView('footer');
?>